//
//  DSVideoSettingTableViewCell.m
//  RONGAO
//
//  Created by ZhangYeKun on 2017/2/24.
//  Copyright © 2017年 wei wang. All rights reserved.
//

#import "DSVideoSettingTableViewCell.h"

NSString * const kDSVideoSettingIdentifier = @"kDSVideoSettingIdentifier";


@implementation DSVideoSettingTableViewCell


- (instancetype)init{
    
    if ([super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:kDSVideoSettingIdentifier]) {
        
        [self masLayoutSubview];
        [self.detailTextLabel setTextColor:[UIColor lightGrayColor]];
        
    }
    
    return self;
    
}

- (void)clickAction:(UIButton *)sender{
    
    
    if (self.click_block) {
        self.click_block(sender);
    }
    
}

- (UIButton *)clickButton{
    
    if (!_clickButton) {
        
        __weak UIView *superView = self;
        _clickButton = [[UIButton alloc]init];
        [superView addSubview:_clickButton];
        [_clickButton setImage:[UIImage imageNamed:@"video_set_bg_nor"] forState:UIControlStateNormal];
        [_clickButton setImage:[UIImage imageNamed:@"video_set_bg_sel"] forState:UIControlStateSelected];
        [_clickButton addTarget:self action:@selector(clickAction:) forControlEvents:UIControlEventTouchDown];
        [_clickButton setContentEdgeInsets:UIEdgeInsetsMake(10, 10, 10, 10)];
    }
    
    return _clickButton;
    
}

- (void)masLayoutSubview{
    
    __weak UIView *superView = self;
    [self.clickButton mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.right.mas_equalTo(superView.mas_right).mas_offset(-20);
        make.centerY.mas_equalTo(superView.mas_centerY);
        
    }];
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
